package com.lcredu.springboot.controller;

import com.lcredu.springboot.entity.Furn;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 黎长容
 * @date 2025-08-08 22:53
 */
@Slf4j
@Controller
public class HelloController {

    @Value("${mywebsite}")
    private String myWebsite;

    @Resource
    private Furn furn;

    @ResponseBody
    @RequestMapping("/hello")
    public String sayHi() throws IOException {
        return "hello world 黎长容";

    }

    @ResponseBody
    @GetMapping("/getFurn")
    public Furn getFurn() {
        log.info("接收到的furn=" + furn);
        log.info("furn1={},furn2={}", furn, furn);
        return furn;
    }
}
